package com.sooncode.project.focusservice.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sooncode.project.core.annotations.Lookup;
import com.sooncode.project.core.annotations.LookupModel;
import com.sooncode.project.focusservice._.base.BaseDomainModel;
import lombok.Data;

import java.util.Date;
import java.util.Map;

@Data
@LookupModel
public class Fee extends BaseDomainModel<Fee> {
    private String orgId;
    @Lookup(fromModel = Organization.class,localField = "orgId",fromField = "name")
    private String orgName;
    private String memberId;
    private String name;
    private double money;
    private String status;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date feeDate;
    private String tollman;
    private String notes;
    @Override
    public void add(Map map){
        map.put("feeDate",new Date());
        super.add(map);
    }
}
